<?php
    session_start();
    
    if((!isset ($_SESSION['login']) == true) and (!isset ($_SESSION['senha']) == true))
    {
        unset($_SESSION['login']);
        unset($_SESSION['senha']);
        header('location:index.php');
    }
    else {
        
        include("conecta.php");

        $user = $_SESSION['login'];
        $sql = "SELECT nome FROM usuario WHERE login='$user'";
        $result = mysql_query($sql);
        $dados = mysql_fetch_assoc($result);

        mysql_close();
    }
    
?>